package com.starlink.common.enums;

import java.util.Arrays;

/**
 * 二级星类型对应关系 1智能穿戴 2测评 3证书 4阅读素养 5写作能力
 */
public enum StarSecondTypeEnum {
    WISDOM_GUARDIAN(1, "智能穿戴"),
    TEST_EVALUATION(2, "测评"),
    CERTIFICATE(3, "证书"),
    READING_LITERACY(4, "阅读素养"),
    WRITING_ABILITY(5, "写作能力"),
    ;

    private Integer type;
    private String desc;

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    StarSecondTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static StarSecondTypeEnum getByType(Integer type) {
        if (type == null) {
            return null;
        }
        return Arrays.stream(values()).filter(item -> type.equals(item.getType())).findFirst().orElse(null);
    }
}
